package training;

import java.util.Scanner;
import java.util.*;
// https://www.nowcoder.com/questionTerminal/0f6976af36324f8bab1ea61e9e826ef5
// 注意类名必须为 test.Main, 不要有任何 package xxx 信息
public class Day31_02 {
    public static List<String> depart(int a) {
        List<String> list = new ArrayList<>();
        for (int i = 2; a > 1 && i * i <= a; i++) {
            while (a % i == 0) {
                list.add(String.valueOf(i));
                a /= i;
            }
        }
        if (a > 1) {
            list.add(String.valueOf(a));
        }
        return list;
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        while (in.hasNextInt()) { // 注意 while 处理多个 case
            int a = in.nextInt();
            List<String> list = depart(a);
//            System.out.printf("%d = %s", a, list);
            System.out.printf("%d = %s\n", a, String.join(" * ", list));
        }
    }
}
